import axios from './api' // 倒入 api
import config from './config.js' // 倒入默认配置
export const BASEURL = config.baseURL

/* 将所有接口统一起来便于维护
 * 如果项目很大可以将 url 独立成文件，接口分成不同的模块
 */

// 医生信息-获取所有医生列表（带分页）
export const GETDOCTORSEARCH = (params) => {
  return axios({
    url: 'doctor/search',
    method: 'GET',
    params,
  })
}

// 医生信息-新增医生信息
export const ADDDOCTORINFO = (params) => {
  return axios({
    url: 'doctor/add',
    method: 'POST',
    data:params,
  })
}

// 医生信息-获取医生详情
export const GETDOCTORINFO = (params) => {
  return axios({
    url: 'doctor/info',
    method: 'GET',
    params,
  })
}

// 医生信息-删除医生信息
export const DELETEDOCTORINFO = (params) => {
  return axios({
    url: 'doctor/delete',
    method: 'GET',
    params,
  })
}

// 医生信息-编辑医生信息
export const EDITDOCTORINFO = (params) => {
  return axios({
    url: 'doctor/edit',
    method: 'POST',
    data:params,
  })
}

// 所有医生
export const GET_DOCTOR_SEARCHALL = (params) => {
  return axios({
    url: 'doctor/searchAll',
    method: 'GET',
    params,
  })
}

// 所有医生-删除医生
export const DELETE_DOCTOR_INFO = (params) => {
  return axios({
    url: 'doctor/delete',
    method: 'GET',
    params,
  })
}

// 医生-下拉列表
export const GET_DOCTOR_OPTIONS = (params) => {
  return axios({
    url: 'doctor/options',
    method: 'GET',
    params,
  })
}